﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bovril.PlayingCards.French
{
    public class Card : IEquatable<Card>, IComparable<Card>
    {
        public Card(int rank, int suit)
        {
            Value = suit + (rank << 8);

            Rank = rank;
            Suit = suit;
        }

        public override String ToString()
        {
            return String.Format("{0} of {1}", RankValue.ToString(Rank), SuitValue.ToString(Suit));
        }

        public bool Equals(Card other)
        {
            return (this.Value == other.Value);
        }

        public int CompareTo(Card other)
        {
            return (this.Value - other.Value);
        }

        public readonly int Value;

        public readonly int Rank;
        public readonly int Suit;
    }
}
